package com.liuliu.zua.service.impl;

import com.liuliu.common.utils.DateUtils;
import com.liuliu.zua.domain.ZuaLecture;
import com.liuliu.zua.mapper.ZuaLectureMapper;
import com.liuliu.zua.service.IZuaLectureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 宣讲会Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-22
 */
@Service
public class ZuaLectureServiceImpl implements IZuaLectureService 
{
    @Autowired
    private ZuaLectureMapper zuaLectureMapper;

    /**
     * 查询宣讲会
     * 
     * @param lectureId 宣讲会ID
     * @return 宣讲会
     */
    @Override
    public ZuaLecture selectZuaLectureById(Long lectureId)
    {
        return zuaLectureMapper.selectZuaLectureById(lectureId);
    }

    /**
     * 查询宣讲会列表
     * 
     * @param zuaLecture 宣讲会
     * @return 宣讲会
     */
    @Override
    public List<ZuaLecture> selectZuaLectureList(ZuaLecture zuaLecture)
    {
        return zuaLectureMapper.selectZuaLectureList(zuaLecture);
    }

    /**
     * 新增宣讲会
     * 
     * @param zuaLecture 宣讲会
     * @return 结果
     */
    @Override
    public int insertZuaLecture(ZuaLecture zuaLecture)
    {
        zuaLecture.setCreateTime(DateUtils.getNowDate());
        return zuaLectureMapper.insertZuaLecture(zuaLecture);
    }

    /**
     * 修改宣讲会
     * 
     * @param zuaLecture 宣讲会
     * @return 结果
     */
    @Override
    public int updateZuaLecture(ZuaLecture zuaLecture)
    {
        zuaLecture.setUpdateTime(DateUtils.getNowDate());
        return zuaLectureMapper.updateZuaLecture(zuaLecture);
    }

    /**
     * 批量删除宣讲会
     * 
     * @param lectureIds 需要删除的宣讲会ID
     * @return 结果
     */
    @Override
    public int deleteZuaLectureByIds(Long[] lectureIds)
    {
        return zuaLectureMapper.deleteZuaLectureByIds(lectureIds);
    }

    /**
     * 删除宣讲会信息
     * 
     * @param lectureId 宣讲会ID
     * @return 结果
     */
    @Override
    public int deleteZuaLectureById(Long lectureId)
    {
        return zuaLectureMapper.deleteZuaLectureById(lectureId);
    }
}
